/**
 * =====================================================================================
 *       @file  nginx.c
 *      @brief  
 *
 *  Detailed description starts here.
 *
 *   @internal
 *     Created  2012年05月08日 20时11分18秒 
 *    Revision  1.0.0.0
 *    Compiler  gcc/g++
 *
 *     @author  luis
 * =====================================================================================
 */

#include <stdio.h>
#include "ngx_core.h"
#include "ngx_cycle.h"
#include "ngx_conf_file.h"
#include "ngx_process_cycle.h"

extern ngx_module_t *ngx_modules[];

ngx_uint_t      ngx_max_module;

int main(int argc, char **argv)
{
    ngx_uint_t i;
    ngx_cycle_t *cycle;

    ngx_pid = ngx_getpid();

    ngx_max_module = 0;
    for (i = 0; ngx_modules[i]; i++)
    {
        ngx_modules[i]->index = ngx_max_module++; 
    }

    cycle = ngx_init_cycle();
    if (cycle == NULL)
    {
        perror("ngx init cycle failed"); 
        return -1;
    }

    ngx_cycle = cycle;
    ngx_master_process_cycle(cycle); 

    return 0;
}

